package org.come.Jpanel;

import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.util.List;

import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JSlider;
import javax.swing.SwingConstants;

import com.tool.btn.RoleCaoZuoBtn;
import come.tool.Fighting.FightingMixDeal;
import come.tool.handle.HandleState;
import org.cbg.btn.TrslationBtn;
import org.come.Frame.*;
import org.come.bean.LoginResult;
import org.come.bean.Mapmodel;
import org.come.control.BabyControl;
import org.come.entity.Baby;
import org.come.mouslisten.SystemMouslisten;
import org.come.mouslisten.WLLMouslisten;
import org.come.until.*;
import org.skill.panel.*;

import com.tool.btn.FormsOnOffBtn;
import com.tool.btn.RefineOperBtn;
import com.tool.btn.WorkshopBtn;
import com.tool.role.RoleData;
import com.tool.tcpimg.UIUtils;
import com.updateNew.MyIsif;
import com.updateNew.MyQdModeJFrame;

//import static org.come.test.Main.imageMap;


public class TestSetupJpanel extends JPanel implements MouseListener {

    private JLabel labFullscreen,// 1366模式
            labFullscreen1,// 1920全屏模式
            labWindow,// 1024模式
            labWindow1,//800模式

    //新增小地图设置
    labSmapcs,// 传送显示
            labSmapnpc,// npc显示
            labSmapqtnpc,// 其他npc显示
    //新增小地图设置
    labDkqsz,// 多开器设置
            labMusic,// 音乐
            labMusicNew,// 新旧音乐切换开关
            labSound,// 音效
            labPlayswitch,// 切磋开关
            labRefusemsg,// 拒绝陌生人消息
            labLetter,// 信件接收
            labJoinfriends,// 加入好友
            labReceiveitems,// 接收物品
            labSkillFull,// 全屏法术
            labSkillFullXJ,// 新旧法术
            jpstyle,// 全屏法术
            xNms,
            xNmsZ,
            xNmsG,
            labAcceptteam;// 接受组队
    //新增小地图设置
    public static String Smapcs,
            Smapnpc,
            Smapqtnpc;
    //新增小地图设置

    private static RoleCaoZuoBtn sureGive;// 解决小地图设置刷新

    private JSlider jSlider;// 银两拉动条
    private WorkshopBtn palBtn;
    private SetupJpanel optionJpanel;// 下拉框
    private final JLabel labName;
    private RefineOperBtn btnDown;// 下拉框

    public SetupJpanel1 optionJpanel1;
    private int leftFlag1;
    public TrslationBtn chooseDownArrows1;
    public JLabel resolutiontext;
    public JLabel resolution1366;

    private WorkshopBtn qlyxhcBtn;// 清理缓存
    private WorkshopBtn changeskin;// 造型切换

    public SetupJpanel2 optionJpanel2;
    private int leftFlag2;
    public TrslationBtn chooseDownArrows2;
    public JLabel interfacialtext;


    public static Font nameFont;
    public JLabel fontsizetext;
    public SetupJpanel3 optionJpanel3;
    private int leftFlag3;
    public TrslationBtn chooseDownArrows3;

    private int leftFlag;

    public TestSetupJpanel() throws Exception {
        this.leftFlag = 1;
        this.leftFlag1 = 1;
        this.leftFlag2 = 1;
        this.leftFlag3 = 1;
        if (MyIsif.getStyle().equals("水墨UI")) {
            this.setPreferredSize(new Dimension(438, 350));
            this.setLayout(null);
            this.setOpaque(false);
            // 关闭按钮事件
            FormsOnOffBtn offBtn = new FormsOnOffBtn("inkImg/old/2/1.png", 1, 50);
            offBtn.setBounds(438 - 37, 10, 25, 25);
            this.add(offBtn);


//分辨率切换
            String[] resolutionData = {"800x600", "1024x768", "1366x768"};
            this.optionJpanel1 = new SetupJpanel1(115, 120, resolutionData);
            optionJpanel1.setBounds(116, 87, 115, 120);
            this.optionJpanel1.getJlist().addMouseListener(new MouseAdapter() {
                @Override
                public void mousePressed(final MouseEvent e) {
                    final String getname = (String) TestSetupJpanel.this.optionJpanel1.getJlist().getSelectedValue();
                    TestSetupJpanel.this.resolutiontext.setText(getname);
                    TestSetupJpanel.this.optionJpanel1.setVisible(false);
                    TestSetupJpanel.this.leftFlag1 = 1;

                    if (TestSetupJpanel.this.resolutiontext.getText().equals("1024x768")) {
                        SystemMouslisten.type1();
                        SystemMouslisten.writeTxt();
                    } else {
                        if (TestSetupJpanel.this.resolutiontext.getText().equals("1366x768")) {
                            SystemMouslisten.type101();
                            SystemMouslisten.writeTxt();
                        } else {
                            SystemMouslisten.type0();
                            SystemMouslisten.writeTxt();
                        }
                    }
                }
            });
            this.optionJpanel1.setVisible(false);
            this.add((Component) this.optionJpanel1);

            (this.resolutiontext = new JLabel("1024x768")).setForeground(Color.white);
            this.resolutiontext.setFont(UIUtils.TXT_lianss);
            resolutiontext.setBounds(132, 67, 96, 20);//选择后的分辨率显示位置
            this.add((Component) this.resolutiontext);
            (this.resolution1366 = new JLabel("1366x768")).setForeground(Color.white);
            this.resolution1366.setFont(UIUtils.TXT_lianss);
            resolutiontext.setBounds(132, 67, 96, 20);//选择后的分辨率显示位置
            this.add((Component) this.resolution1366);

            (this.chooseDownArrows1 = new TrslationBtn("", 1)).addMouseListener(new MouseAdapter() {
                @Override
                public void mousePressed(final MouseEvent e) {
                    if (TestSetupJpanel.this.leftFlag1 == 1) {
                        TestSetupJpanel.this.optionJpanel1.setVisible(true);
                        TestSetupJpanel.this.leftFlag1 = 0;

                        TestSetupJpanel.this.optionJpanel2.setVisible(false);
                        TestSetupJpanel.this.leftFlag2 = 1;
                        TestSetupJpanel.this.optionJpanel3.setVisible(false);
                        TestSetupJpanel.this.leftFlag3 = 1;
                        optionJpanel.setVisible(false);
                    } else {
                        TestSetupJpanel.this.optionJpanel1.setVisible(false);
                        TestSetupJpanel.this.leftFlag1 = 1;
                    }
                }
            });

            chooseDownArrows1.setBounds(116, 67, 115, 20);
            chooseDownArrows1.setIcons(CutButtonImage.cuts("inkImg/newbackground/xl100.png"));
            this.add((Component) this.chooseDownArrows1);


//画质切换
            final String[] interfacialData = {"低画质", "标准画质", "超高画质"};
            this.optionJpanel2 = new SetupJpanel2(115, 120, interfacialData);
            optionJpanel2.setBounds(116, 87 + 30, 115, 120);
            this.optionJpanel2.getJlist().addMouseListener(new MouseAdapter() {
                @Override
                public void mousePressed(final MouseEvent e) {
                    final String getname = (String) TestSetupJpanel.this.optionJpanel2.getJlist().getSelectedValue();
                    TestSetupJpanel.this.interfacialtext.setText(getname);
                    TestSetupJpanel.this.optionJpanel2.setVisible(false);
                    TestSetupJpanel.this.leftFlag2 = 1;
                    if (TestSetupJpanel.this.interfacialtext.getText().equals("低画质")) {
                        SystemMouslisten.type15();
                        SystemMouslisten.writeTxt();
                    } else {
                        if (TestSetupJpanel.this.interfacialtext.getText().equals("标准画质")) {
                            SystemMouslisten.type16();
                            SystemMouslisten.writeTxt();
                        } else if (TestSetupJpanel.this.interfacialtext.getText().equals("超高画质")) {
                            SystemMouslisten.type17();
                            SystemMouslisten.writeTxt();
                        }
                    }
                }
            });
            this.optionJpanel2.setVisible(false);
            this.add((Component) this.optionJpanel2);

            (this.interfacialtext = new JLabel("低画质")).setForeground(Color.white);
            interfacialtext.setBounds(132, 67 + 30, 96, 20);//选择后的分辨率显示位置
            this.interfacialtext.setFont(UIUtils.TEXT_FONT1);
            this.add((Component) this.interfacialtext);

            (this.chooseDownArrows2 = new TrslationBtn("", 1)).addMouseListener(new MouseAdapter() {
                @Override
                public void mousePressed(final MouseEvent e) {
                    if (TestSetupJpanel.this.leftFlag2 == 1) {
                        TestSetupJpanel.this.optionJpanel2.setVisible(true);
                        TestSetupJpanel.this.leftFlag2 = 0;

                        TestSetupJpanel.this.optionJpanel1.setVisible(false);
                        TestSetupJpanel.this.leftFlag1 = 1;
                        TestSetupJpanel.this.optionJpanel3.setVisible(false);
                        TestSetupJpanel.this.leftFlag3 = 1;
                        optionJpanel.setVisible(false);

                    } else {
                        TestSetupJpanel.this.optionJpanel2.setVisible(false);
                        TestSetupJpanel.this.leftFlag2 = 1;

                    }
                }
            });
            chooseDownArrows2.setBounds(116, 67 + 30, 115, 20);
            chooseDownArrows2.setIcons(CutButtonImage.cuts("inkImg/newbackground/xl100.png"));
            this.add((Component) this.chooseDownArrows2);


            //界面风格

            String[] rowData = {"经典红木", "水墨江山"};//取消红木 这里注释掉红木，rowdata1换到下面0哪里
            labName = new JLabel();
            labName.setBounds(132, 67 + 30 * 2, 96, 20);
            labName.setForeground(Color.white);
            labName.setFont(UIUtils.TEXT_FONT1);
            if (MyIsif.getStyle().equals("水墨UI")) {
                labName.setText(rowData[1]);
            } else {
                labName.setText(rowData[0]);
            }
            this.add(labName);
            btnDown = new RefineOperBtn("inkImg/newbackground/xl100.png", 1, this, 3);
            btnDown.setBounds(116, 67 + 30 * 2, 115, 20);
            this.add(btnDown);
            optionJpanel = new SetupJpanel(115, 120, rowData);
            optionJpanel.setBounds(116, 87 + 30 * 2, 115, 120);
            optionJpanel.setVisible(false);
            this.add(optionJpanel);
            //设置红木UI暂时屏蔽
            optionJpanel.getJlist().addMouseListener(new MouseAdapter() {
                @Override
                public void mousePressed(MouseEvent e) {
                    String value = getValue(true);

                    if (value != null) {
                        optionJpanel.setVisible(false);
                    }
                }
            });


//字体切换
            final String[] fontsizeData = {"默认", "楷体", "隶书"};
            this.optionJpanel3 = new SetupJpanel3(115, 90, fontsizeData);
            optionJpanel3.setBounds(116, 87 + 30 * 3, 115, 90);
            this.optionJpanel3.getJlist().addMouseListener(new MouseAdapter() {
                @Override
                public void mousePressed(final MouseEvent e) {
                    final String getname = (String) TestSetupJpanel.this.optionJpanel3.getJlist().getSelectedValue();
                    TestSetupJpanel.this.fontsizetext.setText(getname);
                    TestSetupJpanel.this.optionJpanel3.setVisible(false);
                    TestSetupJpanel.this.leftFlag3 = 1;
                    if (TestSetupJpanel.this.fontsizetext.getText().equals("默认")) {
                        SystemMouslisten.typemoren();
                        SystemMouslisten.writeTxt();
                    }
                    if (TestSetupJpanel.this.fontsizetext.getText().equals("楷体")) {
                        SystemMouslisten.type100();
                        SystemMouslisten.writeTxt();
                    }
                    if (TestSetupJpanel.this.fontsizetext.getText().equals("隶书")) {
                        SystemMouslisten.typelushu();
                        SystemMouslisten.writeTxt();
                    }
                }
            });
            this.optionJpanel3.setVisible(false);
            this.add((Component) this.optionJpanel3);

            (this.fontsizetext = new JLabel("默认")).setForeground(Color.white);
            fontsizetext.setBounds(132, 67 + 30 * 3, 96, 20);//选择后的分辨率显示位置
            this.fontsizetext.setFont(UIUtils.TEXT_FONT1);
            this.add((Component) this.fontsizetext);

            (this.chooseDownArrows3 = new TrslationBtn("", 1)).addMouseListener(new MouseAdapter() {
                @Override
                public void mousePressed(final MouseEvent e) {
                    if (TestSetupJpanel.this.leftFlag3 == 1) {
                        TestSetupJpanel.this.optionJpanel3.setVisible(true);
                        TestSetupJpanel.this.leftFlag3 = 0;

                        TestSetupJpanel.this.optionJpanel1.setVisible(false);
                        TestSetupJpanel.this.leftFlag1 = 1;
                        TestSetupJpanel.this.optionJpanel2.setVisible(false);
                        TestSetupJpanel.this.leftFlag2 = 1;
                    } else {
                        TestSetupJpanel.this.optionJpanel3.setVisible(false);
                        TestSetupJpanel.this.leftFlag3 = 1;
                    }
                }
            });
            chooseDownArrows3.setBounds(116, 67 + 30 * 3, 115, 20);
            chooseDownArrows3.setIcons(CutButtonImage.cuts("inkImg/newbackground/xl100.png"));
            this.add((Component) this.chooseDownArrows3);


            // 分辨率1024 X 768
            labFullscreen = new JLabel();
            this.add((Component) this.labFullscreen);

            // 分辨率800 X 600
            labWindow = new JLabel();
            this.add((Component) this.labWindow);

            // 分辨率1366 X 768
            labFullscreen1 = new JLabel();
            this.add((Component) this.labFullscreen1);

//        // 分辨率1920 X 1080
//        labWindow1 = new JLabel();
//        this.add((Component)this.labWindow1);


            // 流畅模式
            xNms = new JLabel();
            this.add((Component) this.xNms);

            // 高清模式
            xNmsZ = new JLabel();
            this.add((Component) this.xNmsZ);

            // 高清流畅模式
            xNmsG = new JLabel();
            this.add((Component) this.xNmsG);


//新增小地图设置

            // 任务npc显示
            labSmapnpc = new JLabel();
            labSmapnpc.setBounds(102, 69, 0, 0);
            labSmapnpc.addMouseListener(new SystemMouslisten(12));
            this.add((Component) this.labSmapnpc);

            // 其他npc显示
            labSmapqtnpc = new JLabel();
            labSmapqtnpc.setBounds(209, 69, 0, 0);
            labSmapqtnpc.addMouseListener(new SystemMouslisten(13));
            this.add((Component) this.labSmapqtnpc);

            // 传送显示
            labSmapcs = new JLabel();
            labSmapcs.setBounds(316, 69, 0, 0);
            labSmapcs.addMouseListener(new SystemMouslisten(14));
            this.add((Component) this.labSmapcs);

//新增小地图设置


            // 音乐
            labMusic = new JLabel();
            labMusic.setBounds(59, 250, 16, 14);
            labMusic.addMouseListener(new SystemMouslisten(2));
            this.add((Component) this.labMusic);

            // 音效
            labSound = new JLabel();
            labSound.setBounds(139, 250, 16, 14);
            labSound.addMouseListener(new SystemMouslisten(3));
            this.add((Component) this.labSound);


            // 新旧音乐切换开关
            labMusicNew = new JLabel();
//        labMusicNew.setBounds(102, 230+27*3, 16, 14);
            labMusicNew.setBounds(59, 220, 16, 14);
            labMusicNew.addMouseListener(new SystemMouslisten(11));
            this.add((Component) this.labMusicNew);


            // 新旧法术
            labSkillFullXJ = new JLabel();
            labSkillFullXJ.setBounds(264, 70, 16, 14);
            labSkillFullXJ.addMouseListener(new SystemMouslisten(18));
            this.add((Component) this.labSkillFullXJ);


            // 全屏法术
            labSkillFull = new JLabel();
//        labSkillFull.setBounds(257, 230, 16, 14);
            labSkillFull.setBounds(264, 70 + 29, 16, 14);
            labSkillFull.addMouseListener(new SystemMouslisten(10));
            this.add((Component) this.labSkillFull);

            // 切磋开关
            labPlayswitch = new JLabel();
            labPlayswitch.setBounds(264, 70 + 29 * 2, 16, 14);
            labPlayswitch.addMouseListener(new SystemMouslisten(4));
            this.add((Component) this.labPlayswitch);

            // 接受组队
            labAcceptteam = new JLabel();
            labAcceptteam.setBounds(264, 70 + 29 * 3, 16, 14);
            labAcceptteam.addMouseListener(new SystemMouslisten(9));
            this.add((Component) this.labAcceptteam);

            // 加入好友
            labJoinfriends = new JLabel();
            labJoinfriends.setBounds(264, 70 + 29 * 4, 16, 14);
            labJoinfriends.addMouseListener(new SystemMouslisten(7));
            this.add((Component) this.labJoinfriends);

            // 接收物品
            labReceiveitems = new JLabel();
            labReceiveitems.setBounds(264, 70 + 29 * 5, 16, 14);
            labReceiveitems.addMouseListener(new SystemMouslisten(8));
            this.add((Component) this.labReceiveitems);

            // 信件接收
            labLetter = new JLabel();
            labLetter.setBounds(264, 70 + 29 * 6, 16, 14);
            labLetter.addMouseListener(new SystemMouslisten(6));
            this.add((Component) this.labLetter);

            // 拒绝陌生人消息
            labRefusemsg = new JLabel();
            labRefusemsg.setBounds(264, 70 + 29 * 7, 16, 14);
            labRefusemsg.addMouseListener(new SystemMouslisten(5));
            this.add((Component) this.labRefusemsg);


//            jSlider = new JSlider(SwingConstants.HORIZONTAL, 0, 100, 100);
//            jSlider.setBounds(55, 280, 200, 5);
//            jSlider.setBackground(UIUtils.Color_BACK);
//            jSlider.setUI(new MySliderUI());
//            this.add((Component)this.jSlider);


            // 多开器设置
            labDkqsz = new JLabel();
            labDkqsz.setBounds(296 + 40, 160, 0, 0);
            labDkqsz.addMouseListener(new SystemMouslisten(103));
            this.add((Component) this.labDkqsz);


            // 游戏缓存清理
            qlyxhcBtn = new WorkshopBtn("skin/8100226/newbutton/B34.PNG", 1, UIUtils.COLOR_BTNTEXT, UIUtils.TEXT_FONT11, "清理缓存", 30);
            qlyxhcBtn.setBounds(116, 188, 68, 17);
            this.qlyxhcBtn.addMouseListener(new WLLMouslisten(400));
            this.add(this.qlyxhcBtn);

//            //造型切换
//            changeskin = new WorkshopBtn("skin/8100226/newbutton/B34.PNG", 1, UIUtils.COLOR_BTNTEXT, UIUtils.TEXT_FONT11, "造型切换", 400);
//            changeskin.setBounds(186 , 188, 68, 17);
//            this.changeskin.addMouseListener(new WLLMouslisten(403));
//            this.add(changeskin);

            jSlider = new JSlider(SwingConstants.HORIZONTAL, 0, 100, 100);
            jSlider.setBounds(50, 278, 185, 10);
            jSlider.setBackground(UIUtils.Color_BACK);
            jSlider.setUI(new MySliderUI());

            jSlider.addMouseListener(new MouseAdapter() {

                @Override
                public void mouseReleased(MouseEvent e) {
                    super.mouseReleased(e);

                    float sec = jSlider.getValue();

                }
            });
            this.add(jSlider);
        } else {
            this.setPreferredSize(new Dimension(395, 369));
            this.setLayout(null);
            this.setOpaque(false);
            // 关闭按钮事件
            FormsOnOffBtn offBtn = new FormsOnOffBtn("inkImg/hongmu/1/s74.png", 1, 50);
            offBtn.setBounds(395 - 25, 0, 25, 25);
            this.add(offBtn);


//分辨率切换
            String[] resolutionData = {"800x600", "1024x768", "1366x768"};
            this.optionJpanel1 = new SetupJpanel1(115, 120, resolutionData);
            optionJpanel1.setBounds(88, 103, 115, 120);
            this.optionJpanel1.getJlist().addMouseListener(new MouseAdapter() {
                @Override
                public void mousePressed(final MouseEvent e) {
                    final String getname = (String) TestSetupJpanel.this.optionJpanel1.getJlist().getSelectedValue();
                    TestSetupJpanel.this.resolutiontext.setText(getname);
                    TestSetupJpanel.this.optionJpanel1.setVisible(false);
                    TestSetupJpanel.this.leftFlag1 = 1;

                    if (TestSetupJpanel.this.resolutiontext.getText().equals("1024x768")) {
                        SystemMouslisten.type1();
                        SystemMouslisten.writeTxt();
                    } else {
                        if (TestSetupJpanel.this.resolutiontext.getText().equals("1366x768")) {
                            SystemMouslisten.type101();
                            SystemMouslisten.writeTxt();
                        } else {
                            SystemMouslisten.type0();
                            SystemMouslisten.writeTxt();
                        }
                    }
                }
            });
            this.optionJpanel1.setVisible(false);
            this.add((Component) this.optionJpanel1);

            (this.resolutiontext = new JLabel("1024x768")).setForeground(Color.white);
            this.resolutiontext.setFont(UIUtils.TXT_lianss);
            resolutiontext.setBounds(104, 83, 96, 20);//选择后的分辨率显示位置
            this.add((Component) this.resolutiontext);
            (this.resolution1366 = new JLabel("1366x768")).setForeground(Color.white);
            this.resolution1366.setFont(UIUtils.TXT_lianss);
            resolutiontext.setBounds(104, 83, 96, 20);//选择后的分辨率显示位置
            this.add((Component) this.resolution1366);

            (this.chooseDownArrows1 = new TrslationBtn("", 1)).addMouseListener(new MouseAdapter() {
                @Override
                public void mousePressed(final MouseEvent e) {
                    if (TestSetupJpanel.this.leftFlag1 == 1) {
                        TestSetupJpanel.this.optionJpanel1.setVisible(true);
                        TestSetupJpanel.this.leftFlag1 = 0;

                        TestSetupJpanel.this.optionJpanel2.setVisible(false);
                        TestSetupJpanel.this.leftFlag2 = 1;
                        TestSetupJpanel.this.optionJpanel3.setVisible(false);
                        TestSetupJpanel.this.leftFlag3 = 1;
                        optionJpanel.setVisible(false);
                    } else {
                        TestSetupJpanel.this.optionJpanel1.setVisible(false);
                        TestSetupJpanel.this.leftFlag1 = 1;
                    }
                }
            });

            chooseDownArrows1.setBounds(88, 83, 115, 20);
            chooseDownArrows1.setIcons(CutButtonImage.cuts("inkImg/hongmu/2/47_png.button.combobox.png"));
            this.add((Component) this.chooseDownArrows1);


//画质切换
            final String[] interfacialData = {"低画质", "标准画质", "超高画质"};
            this.optionJpanel2 = new SetupJpanel2(115, 120, interfacialData);
            optionJpanel2.setBounds(88, 103 + 30, 115, 120);
            this.optionJpanel2.getJlist().addMouseListener(new MouseAdapter() {
                @Override
                public void mousePressed(final MouseEvent e) {
                    final String getname = (String) TestSetupJpanel.this.optionJpanel2.getJlist().getSelectedValue();
                    TestSetupJpanel.this.interfacialtext.setText(getname);
                    TestSetupJpanel.this.optionJpanel2.setVisible(false);
                    TestSetupJpanel.this.leftFlag2 = 1;
                    if (TestSetupJpanel.this.interfacialtext.getText().equals("低画质")) {
                        SystemMouslisten.type15();
                        SystemMouslisten.writeTxt();
                    } else {
                        if (TestSetupJpanel.this.interfacialtext.getText().equals("标准画质")) {
                            SystemMouslisten.type16();
                            SystemMouslisten.writeTxt();
                        } else if (TestSetupJpanel.this.interfacialtext.getText().equals("超高画质")) {
                            SystemMouslisten.type17();
                            SystemMouslisten.writeTxt();
                        }
                    }
                }
            });
            this.optionJpanel2.setVisible(false);
            this.add((Component) this.optionJpanel2);

            (this.interfacialtext = new JLabel("低画质")).setForeground(Color.white);
            interfacialtext.setBounds(104, 83 + 30, 96, 20);//选择后的分辨率显示位置
            this.interfacialtext.setFont(UIUtils.TEXT_FONT1);
            this.add((Component) this.interfacialtext);

            (this.chooseDownArrows2 = new TrslationBtn("", 1)).addMouseListener(new MouseAdapter() {
                @Override
                public void mousePressed(final MouseEvent e) {
                    if (TestSetupJpanel.this.leftFlag2 == 1) {
                        TestSetupJpanel.this.optionJpanel2.setVisible(true);
                        TestSetupJpanel.this.leftFlag2 = 0;

                        TestSetupJpanel.this.optionJpanel1.setVisible(false);
                        TestSetupJpanel.this.leftFlag1 = 1;
                        TestSetupJpanel.this.optionJpanel3.setVisible(false);
                        TestSetupJpanel.this.leftFlag3 = 1;
                        optionJpanel.setVisible(false);

                    } else {
                        TestSetupJpanel.this.optionJpanel2.setVisible(false);
                        TestSetupJpanel.this.leftFlag2 = 1;

                    }
                }
            });
            chooseDownArrows2.setBounds(88, 83 + 30, 115, 20);
            chooseDownArrows2.setIcons(CutButtonImage.cuts("inkImg/hongmu/2/47_png.button.combobox.png"));
            this.add((Component) this.chooseDownArrows2);


            //界面风格

            String[] rowData = {"经典红木", "水墨江山"};
            labName = new JLabel();
            labName.setBounds(104, 83 + 30 * 2, 96, 20);
            labName.setForeground(Color.white);
            labName.setFont(UIUtils.TEXT_FONT1);
            if (MyIsif.getStyle().equals("水墨UI")) {
                labName.setText(rowData[1]);
            } else {
                labName.setText(rowData[0]);
            }
            this.add(labName);
            btnDown = new RefineOperBtn("inkImg/hongmu/2/47_png.button.combobox.png", 1, this, 3);
            btnDown.setBounds(88, 83 + 30 * 2, 115, 20);
            this.add(btnDown);
            optionJpanel = new SetupJpanel(115, 120, rowData);
            optionJpanel.setBounds(88, 103 + 30 * 2, 115, 120);
            optionJpanel.setVisible(false);
            this.add(optionJpanel);
            optionJpanel.getJlist().addMouseListener(new MouseAdapter() {
                @Override
                public void mousePressed(MouseEvent e) {

                    String value = getValue(true);
                    if (value != null) {
                        optionJpanel.setVisible(false);
                    }
                }
            });


//字体切换
            final String[] fontsizeData = {"默认", "楷体", "隶书"};
            this.optionJpanel3 = new SetupJpanel3(115, 90, fontsizeData);
            optionJpanel3.setBounds(88, 103 + 30 * 3, 115, 90);
            this.optionJpanel3.getJlist().addMouseListener(new MouseAdapter() {
                @Override
                public void mousePressed(final MouseEvent e) {
                    final String getname = (String) TestSetupJpanel.this.optionJpanel3.getJlist().getSelectedValue();
                    TestSetupJpanel.this.fontsizetext.setText(getname);
                    TestSetupJpanel.this.optionJpanel3.setVisible(false);
                    TestSetupJpanel.this.leftFlag3 = 1;
                    if (TestSetupJpanel.this.fontsizetext.getText().equals("默认")) {
                        SystemMouslisten.typemoren();
                        SystemMouslisten.writeTxt();
                    }
                    if (TestSetupJpanel.this.fontsizetext.getText().equals("楷体")) {
                        SystemMouslisten.type100();
                        SystemMouslisten.writeTxt();
                    }
                    if (TestSetupJpanel.this.fontsizetext.getText().equals("隶书")) {
                        SystemMouslisten.typelushu();
                        SystemMouslisten.writeTxt();
                    }
                }
            });
            this.optionJpanel3.setVisible(false);
            this.add((Component) this.optionJpanel3);

            (this.fontsizetext = new JLabel("默认")).setForeground(Color.white);
            fontsizetext.setBounds(104, 83 + 30 * 3, 96, 20);//选择后的分辨率显示位置
            this.fontsizetext.setFont(UIUtils.TEXT_FONT1);
            this.add((Component) this.fontsizetext);

            (this.chooseDownArrows3 = new TrslationBtn("", 1)).addMouseListener(new MouseAdapter() {
                @Override
                public void mousePressed(final MouseEvent e) {
                    if (TestSetupJpanel.this.leftFlag3 == 1) {
                        TestSetupJpanel.this.optionJpanel3.setVisible(true);
                        TestSetupJpanel.this.leftFlag3 = 0;

                        TestSetupJpanel.this.optionJpanel1.setVisible(false);
                        TestSetupJpanel.this.leftFlag1 = 1;
                        TestSetupJpanel.this.optionJpanel2.setVisible(false);
                        TestSetupJpanel.this.leftFlag2 = 1;
                    } else {
                        TestSetupJpanel.this.optionJpanel3.setVisible(false);
                        TestSetupJpanel.this.leftFlag3 = 1;
                    }
                }
            });
            chooseDownArrows3.setBounds(88, 83 + 30 * 3, 115, 20);
            chooseDownArrows3.setIcons(CutButtonImage.cuts("inkImg/hongmu/2/47_png.button.combobox.png"));
            this.add((Component) this.chooseDownArrows3);


            // 分辨率1024 X 768
            labFullscreen = new JLabel();
            this.add((Component) this.labFullscreen);

            // 分辨率800 X 600
            labWindow = new JLabel();
            this.add((Component) this.labWindow);

            // 分辨率1366 X 768
            labFullscreen1 = new JLabel();
            this.add((Component) this.labFullscreen1);

//        // 分辨率1920 X 1080
//        labWindow1 = new JLabel();
//        this.add((Component)this.labWindow1);


            // 流畅模式
            xNms = new JLabel();
            this.add((Component) this.xNms);

            // 高清模式
            xNmsZ = new JLabel();
            this.add((Component) this.xNmsZ);

            // 高清流畅模式
            xNmsG = new JLabel();
            this.add((Component) this.xNmsG);


//新增小地图设置

            // 任务npc显示
            labSmapnpc = new JLabel();
            labSmapnpc.setBounds(102, 69, 0, 0);
            labSmapnpc.addMouseListener(new SystemMouslisten(12));
            this.add((Component) this.labSmapnpc);

            // 其他npc显示
            labSmapqtnpc = new JLabel();
            labSmapqtnpc.setBounds(209, 69, 0, 0);
            labSmapqtnpc.addMouseListener(new SystemMouslisten(13));
            this.add((Component) this.labSmapqtnpc);

            // 传送显示
            labSmapcs = new JLabel();
            labSmapcs.setBounds(316, 69, 0, 0);
            labSmapcs.addMouseListener(new SystemMouslisten(14));
            this.add((Component) this.labSmapcs);

//新增小地图设置


            // 音乐
            labMusic = new JLabel();
            labMusic.setBounds(59 - 28, 250 + 16, 16, 14);
            labMusic.addMouseListener(new SystemMouslisten(2));
            this.add((Component) this.labMusic);

            // 音效
            labSound = new JLabel();
            labSound.setBounds(139 - 28, 250 + 16, 16, 14);
            labSound.addMouseListener(new SystemMouslisten(3));
            this.add((Component) this.labSound);


            // 新旧音乐切换开关
            labMusicNew = new JLabel();
//        labMusicNew.setBounds(102, 230+27*3, 16, 14);
            labMusicNew.setBounds(59 - 28, 220 + 16, 16, 14);
            labMusicNew.addMouseListener(new SystemMouslisten(11));
            this.add((Component) this.labMusicNew);


            // 新旧法术
            labSkillFullXJ = new JLabel();
            labSkillFullXJ.setBounds(237, 86, 16, 14);
            labSkillFullXJ.addMouseListener(new SystemMouslisten(18));
            this.add((Component) this.labSkillFullXJ);


            // 全屏法术
            labSkillFull = new JLabel();
//        labSkillFull.setBounds(257, 230, 16, 14);
            labSkillFull.setBounds(237, 86 + 29, 16, 14);
            labSkillFull.addMouseListener(new SystemMouslisten(10));
            this.add((Component) this.labSkillFull);

            // 切磋开关
            labPlayswitch = new JLabel();
            labPlayswitch.setBounds(237, 86 + 29 * 2, 16, 14);
            labPlayswitch.addMouseListener(new SystemMouslisten(4));
            this.add((Component) this.labPlayswitch);

            // 接受组队
            labAcceptteam = new JLabel();
            labAcceptteam.setBounds(237, 86 + 29 * 3, 16, 14);
            labAcceptteam.addMouseListener(new SystemMouslisten(9));
            this.add((Component) this.labAcceptteam);

            // 加入好友
            labJoinfriends = new JLabel();
            labJoinfriends.setBounds(237, 86 + 29 * 4, 16, 14);
            labJoinfriends.addMouseListener(new SystemMouslisten(7));
            this.add((Component) this.labJoinfriends);

            // 接收物品
            labReceiveitems = new JLabel();
            labReceiveitems.setBounds(237, 86 + 29 * 5, 16, 14);
            labReceiveitems.addMouseListener(new SystemMouslisten(8));
            this.add((Component) this.labReceiveitems);

            // 信件接收
            labLetter = new JLabel();
            labLetter.setBounds(237, 86 + 29 * 6, 16, 14);
            labLetter.addMouseListener(new SystemMouslisten(6));
            this.add((Component) this.labLetter);

            // 拒绝陌生人消息
            labRefusemsg = new JLabel();
            labRefusemsg.setBounds(237, 86 + 29 * 7, 16, 14);
            labRefusemsg.addMouseListener(new SystemMouslisten(5));
            this.add((Component) this.labRefusemsg);


//            jSlider = new JSlider(SwingConstants.HORIZONTAL, 0, 100, 100);
//            jSlider.setBounds(55, 280, 200, 5);
//            jSlider.setBackground(UIUtils.Color_BACK);
//            jSlider.setUI(new MySliderUI());
//            this.add((Component)this.jSlider);


            // 多开器设置
            labDkqsz = new JLabel();
            labDkqsz.setBounds(296 + 40, 160, 0, 0);
            labDkqsz.addMouseListener(new SystemMouslisten(103));
            this.add((Component) this.labDkqsz);


            // 游戏缓存清理
            qlyxhcBtn = new WorkshopBtn("inkImg/hongmu/1/B34h.png", 1, UIUtils.COLOR_BTNPUTONG2, UIUtils.TEXT_FONT11, "清理缓存", 30);
            qlyxhcBtn.setBounds(88, 188 + 16, 68, 17);
            this.qlyxhcBtn.addMouseListener(new WLLMouslisten(400));
            this.add(this.qlyxhcBtn);

//            //造型切换
//            changeskin = new WorkshopBtn("inkImg/hongmu/1/B34h.png", 1, UIUtils.COLOR_BTNPUTONG2, UIUtils.TEXT_FONT11, "造型切换", 400);
//            changeskin.setBounds(158 , 188 + 16, 68, 17);
//            this.changeskin.addMouseListener(new WLLMouslisten(403));
//            this.add(changeskin);


            jSlider = new JSlider(SwingConstants.HORIZONTAL, 0, 100, 100);
            jSlider.setBounds(50 - 28, 278 + 16, 185, 10);
            jSlider.setBackground(UIUtils.Color_BACK);
            jSlider.setUI(new MySliderUI());

            jSlider.addMouseListener(new MouseAdapter() {

                @Override
                public void mouseReleased(MouseEvent e) {
                    super.mouseReleased(e);

                    float sec = jSlider.getValue();

                }
            });
            this.add(jSlider);
        }


    }


    /**
     * 展示与隐藏下拉框
     */
    public void showArenaDownLab() {
        optionJpanel.setVisible(!optionJpanel.isVisible());
    }

    /**
     * 选择风格
     */
    public String getValue(boolean type) {
        if (FightingMixDeal.State != HandleState.USUAL) {
            ZhuFrame.getZhuJpanel().addPrompt2("战斗中,不能切换");
            return null;
        } else {
            JList<String> jlist = optionJpanel.getJlist();
            String selectedValue = jlist.getSelectedValue();
            labName.setText(selectedValue);
            if (selectedValue.equals("经典红木")) {
                MyQdModeJFrame.updateStyle("红木UI");
            } else if (selectedValue.equals("水墨江山")) {
                MyQdModeJFrame.updateStyle("水墨UI");
            }

            for (int i = 0; i < 3123; i++) {
                final Integer num = (Integer) FormsManagement.map.get(Integer.valueOf(i));
                if (num != null && i != 22) {
                    FormsManagement.HideForm(i);
                }
            }
            for (int i = 0; i < 3123; i++) {
                final Integer num = (Integer) FormsManagement.map.get(Integer.valueOf(i));
                if (num != null && i != 22) {
                    FormsManagement.getInternalFormsx(i);
                }
            }
            if (MyIsif.getStyle().equals("水墨UI")) {
                //小地图刷新
                Util.mapmodel.setZoom(CutButtonImage.cuts("inkImg/old/background/49.png", 1, 1, false));
                Util.mapmodel.MiniMap((new ImageIcon("inkImg/number/npk/s/s" + Util.ditubianma + ".png")).getImage());//重点关注
            } else {
                //小地图刷新
                Util.mapmodel.setZoom(CutButtonImage.cuts("inkImg/old/background/49.png", 1, 1, false));
                Util.mapmodel.MiniMap((new ImageIcon("inkImg/number/npk/s/h" + Util.ditubianma + ".png")).getImage());//重点关注
            }
            ZhuJpanel.styles = true;
//            FrameMessageChangeJpanel.styles = true;
            SystemMouslisten.readSysteminit();
            LoginResult loginResult = RoleData.getRoleData().getLoginResult();
            GoodsListFromServerUntil.GoodExpansion(loginResult.getTurnAround(), loginResult.getAttachPack());
            List<Baby> a = UserMessUntil.getMyListBaby();
            BabyControl.babyinit(a);
            for (int i = 0; i < a.size(); i++) {
                TestChildJframe.getTestChildJframe().getTestChildJpanel().ShowBaby((Baby) a.get(i));
            }
          /*  if (MyIsif.getStyle().equals("水墨UI")){
                ShoppingBuyJframe.getShoppingBuyJframe().getShoppingBuyJpanel().getIcon().setImage(new ImageIcon("inkImg/hongmu/1/ss666.png").getImage());
            }*/
//        Baby baby = UserMessUntil.getbaby(RoleData.getRoleData().getLoginResult().getBabyId());
//        TestChildJframe.getTestChildJframe().getTestChildJpanel().ShowBaby(baby);
            return selectedValue;
        }
    }

    /**
     * 隐藏或展示 选择风格
     */
    public String concealArena(boolean type) {
        optionJpanel.setVisible(false);
        btnDown.setVisible(type);
        labName.setVisible(type);
        if (type) {
            return getValue(false);
        }
        return null;
    }


    private ImageIcon icon;

    @Override
    protected void paintComponent(Graphics g) {
        super.paintComponent(g);
        if (MyIsif.getStyle().equals("水墨UI")) {
            if (icon == null)
                icon = new ImageIcon("inkImg/newbackground/B211a.png");
            // 设置面板
            g.drawImage(icon.getImage(), 0, 0, 438, 350, this);
        } else {
            if (icon == null)
                icon = new ImageIcon("inkImg/hongmu/B211ah.png");
            // 设置面板
            g.drawImage(icon.getImage(), 0, 0, 395, 369, this);
        }


    }


    @Override
    public void mouseClicked(MouseEvent e) {
        // TODO Auto-generated method stub

    }

    @Override
    public void mousePressed(MouseEvent e) {
        // TODO Auto-generated method stub

    }

    @Override
    public void mouseReleased(MouseEvent e) {

    }

    @Override
    public void mouseEntered(MouseEvent e) {
        // TODO Auto-generated method stub

    }

    @Override
    public void mouseExited(MouseEvent e) {
        // TODO Auto-generated method stub

    }

    public JLabel getLabFullscreen() {
        return labFullscreen;
    }

    public void setLabFullscreen(JLabel labFullscreen) {
        this.labFullscreen = labFullscreen;
    }

    public JLabel getLabFullscreen1() {
        return labFullscreen1;
    }

    public void setLabFullscreen1(JLabel labFullscreen1) {
        this.labFullscreen1 = labFullscreen1;
    }


    public JLabel getLabWindow() {
        return labWindow;
    }

    public void setLabWindow(JLabel labWindow) {
        this.labWindow = labWindow;
    }

//    public JLabel getLabWindow1() {
//        return labWindow1;
//    }
//
//    public void setLabWindow1(JLabel labWindow1) {
//        this.labWindow1 = labWindow1;
//    }


    //新增小地图设置

    public JLabel getLabSmapcs() {
        return labSmapcs;
    }

    public void setLabSmapcs(JLabel labSmapcs) {
        this.labSmapcs = labSmapcs;
    }


    public JLabel getLabSmapnpc() {
        return labSmapnpc;
    }

    public void setLabSmapnpc(JLabel labSmapnpc) {
        this.labSmapnpc = labSmapnpc;
    }

    public JLabel getLabSmapqtnpc() {
        return labSmapqtnpc;
    }

    public void setLabSmapqtnpc(JLabel labSmapqtnpc) {
        this.labSmapqtnpc = labSmapqtnpc;
    }

    //新增小地图设置


    public JLabel getXNms() {
        return xNms;
    }

    public void setXNms(JLabel xNms) {
        this.xNms = xNms;
    }


    public JLabel getXNmsZ() {
        return xNmsZ;
    }

    public void setXNmsZ(JLabel xNmsZ) {
        this.xNmsZ = xNmsZ;
    }

    public JLabel getXNmsG() {
        return xNmsG;
    }

    public void setXNmsG(JLabel xNmsG) {
        this.xNmsG = xNmsG;
    }


    public JLabel getLabDkqsz() {
        return labDkqsz;
    }

    public void setLabDkqsz(JLabel labDkqsz) {
        this.labDkqsz = labDkqsz;
    }


    public JLabel getLabMusic() {
        return labMusic;
    }

    public void setLabMusic(JLabel labMusic) {
        this.labMusic = labMusic;
    }


    public JLabel getLabMusicNew() {
        return labMusicNew;
    }

    public void setLabMusicNew(JLabel labMusicNew) {
        this.labMusicNew = labMusicNew;
    }

    public JLabel getLabSound() {
        return labSound;
    }

    public void setLabSound(JLabel labSound) {
        this.labSound = labSound;
    }

    public JLabel getLabPlayswitch() {
        return labPlayswitch;
    }

    public void setLabPlayswitch(JLabel labPlayswitch) {
        this.labPlayswitch = labPlayswitch;
    }

    public JLabel getLabRefusemsg() {
        return labRefusemsg;
    }

    public void setLabRefusemsg(JLabel labRefusemsg) {
        this.labRefusemsg = labRefusemsg;
    }

    public JLabel getLabLetter() {
        return labLetter;
    }

    public void setLabLetter(JLabel labLetter) {
        this.labLetter = labLetter;
    }

    public JLabel getLabJoinfriends() {
        return labJoinfriends;
    }

    public void setLabJoinfriends(JLabel labJoinfriends) {
        this.labJoinfriends = labJoinfriends;
    }

    public JLabel getLabReceiveitems() {
        return labReceiveitems;
    }

    public void setLabReceiveitems(JLabel labReceiveitems) {
        this.labReceiveitems = labReceiveitems;
    }

    public JLabel getLabAcceptteam() {
        return labAcceptteam;
    }

    public void setLabAcceptteam(JLabel labAcceptteam) {
        this.labAcceptteam = labAcceptteam;
    }

    public JLabel getLabSkillFull() {
        return labSkillFull;
    }

    public void setLabSkillFull(JLabel labSkillFull) {
        this.labSkillFull = labSkillFull;
    }

    public JLabel getLabSkillFullXJ() {
        return labSkillFullXJ;
    }

    public void setLabSkillFullXJ(JLabel labSkillFullXJ) {
        this.labSkillFullXJ = labSkillFullXJ;
    }

    public JLabel getJpstyle() {
        return jpstyle;
    }

    public void setJpstyle(JLabel jpstyle) {
        this.jpstyle = jpstyle;
    }

    public SetupJpanel getOptionJpanel() {
        return optionJpanel;
    }

    public void setOptionJpanel(SetupJpanel optionJpanel) {
        this.optionJpanel = optionJpanel;
    }


    public void sfindu() {
        ImageIcon tips = new ImageIcon("inkImg/old/background/S33.png");
    }


    public int getLeftFlag() {
        return this.leftFlag;
    }

    public void setLeftFlag(final int leftFlag) {
        this.leftFlag = leftFlag;
    }


    public TrslationBtn getChooseDownArrows1() {
        return this.chooseDownArrows1;
    }

    public void setChooseDownArrows1(final TrslationBtn chooseDownArrows1) {
        this.chooseDownArrows1 = chooseDownArrows1;
    }

    public SetupJpanel1 getOptionJpanel1() {
        return this.optionJpanel1;
    }

    public void setOptionJpanel1(final SetupJpanel1 optionJpanel1) {
        this.optionJpanel1 = optionJpanel1;
    }

    public int getLeftFlag1() {
        return this.leftFlag1;
    }

    public void setLeftFlag1(final int leftFlag1) {
        this.leftFlag1 = leftFlag1;
    }

    public JLabel getResolutiontext() {
        return this.resolutiontext;
    }

    public void setResolutiontext(final JLabel resolutiontext) {
        this.resolutiontext = resolutiontext;
    }

    public JLabel getResolution1366() {
        return this.resolution1366;
    }

    public void setResolution1366(final JLabel resolution1366) {
        this.resolution1366 = resolution1366;
    }


    public TrslationBtn getChooseDownArrows2() {
        return this.chooseDownArrows2;
    }

    public void setChooseDownArrows2(final TrslationBtn chooseDownArrows2) {
        this.chooseDownArrows2 = chooseDownArrows2;
    }

    public SetupJpanel2 getOptionJpanel2() {
        return this.optionJpanel2;
    }

    public void setOptionJpanel2(final SetupJpanel2 optionJpanel2) {
        this.optionJpanel2 = optionJpanel2;
    }

    public int getLeftFlag2() {
        return this.leftFlag2;
    }

    public void setLeftFlag2(final int leftFlag2) {
        this.leftFlag2 = leftFlag2;
    }

    public JLabel getInterfacialtext() {
        return this.interfacialtext;
    }

    public void setInterfacialtext(final JLabel interfacialtext) {
        this.interfacialtext = interfacialtext;
    }


    public TrslationBtn getChooseDownArrows3() {
        return this.chooseDownArrows3;
    }

    public void setChooseDownArrows3(final TrslationBtn chooseDownArrows3) {
        this.chooseDownArrows3 = chooseDownArrows3;
    }


    public SetupJpanel3 getOptionJpanel3() {
        return this.optionJpanel3;
    }

    public void setOptionJpanel3(final SetupJpanel3 optionJpanel3) {
        this.optionJpanel3 = optionJpanel3;
    }

    public int getLeftFlag3() {
        return this.leftFlag3;
    }

    public void setLeftFlag3(final int leftFlag3) {
        this.leftFlag3 = leftFlag3;
    }

    public JLabel getFontsizetext() {
        return this.fontsizetext;
    }

    public void setFontsizetext(final JLabel fontsizetext) {
        this.fontsizetext = fontsizetext;
    }

}
